﻿<Window
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:local="clr-namespace:urBook.Gui" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" x:Class="urBook.Gui.MainWindow"
        Title="Address Book" MinHeight="600" MinWidth="800" Closing="Window_Closing">
    
    <Grid x:Name="Container" Background="#FFC3C3F2">
        <ContentControl Height="64" x:Name="UtilitiesBar" VerticalAlignment="Top" HorizontalAlignment="Stretch" Background="#FFC3C3F2" >
            <Grid Background="AliceBlue" Margin="8">
                <TextBlock Text="Search:" Width="64" Height="32" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,8,312,8" TextAlignment="Right" FontSize="20" Foreground="{StaticResource ForegroundBrushKey}"/>
                <TextBox x:Name="SearchValue" Width="256" Height="32"  HorizontalAlignment="Right" VerticalAlignment="Center" Margin="48,8" FontSize="20" TextChanged="SearchValue_TextChanged"  />
                <Button x:Name="UtilitiesButton" Width="32" Height="32" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="8" Click="UtilitiesButton_Click" BorderBrush="#FFC3C3F2" Background="AliceBlue" Foreground="#FF0000A1">
                    <Image  Width="24" Height="24" Source="data/images/settings.png" />
                    <Button.ContextMenu>
                        <ContextMenu x:Name="UtilitiesMenu">
                            <MenuItem Header="New _Contact" Click="NewContact_Click"/>
                            <MenuItem Header="New _Group" Click="NewGroup_Click"/>
                            <MenuItem Header="New _Profile" Click="NewProfile_Click"/>
                            <Separator/>
                            <MenuItem Header="_Save" Click="Save_Click"/>
                            <MenuItem Header="_Edit" Click="Edit_Click"/>
                            <MenuItem Header="_Delete" Click="Delete_Click"/>
                            <Separator/>
                            <MenuItem Command="ApplicationCommands.Copy"/>
                            <MenuItem Command="ApplicationCommands.Cut"/>
                            <MenuItem Command="ApplicationCommands.Paste"/>
                            <MenuItem Header="_Refresh" Click="Refresh_Click"/>
                            <Separator/>
                            <MenuItem Header="Find _Duplicates" Click="Find_Click"/>
                            <MenuItem Header="_Merge Contacts" Click="Merge_Click"/>
                            <MenuItem Header="_Append Country Code" Click="Append_Click"/>
                            <MenuItem Header="_Format Contacts" Click="Format_Click"/>
                            <MenuItem Header="_Import Contacts" Click="Import_Click"/>
                            <MenuItem Header="_Export Contacts" Click="Export_Click"/>
                            <Separator/>
                            <MenuItem Header="About Address Book" Click="About_Click"/>
                            <MenuItem Header="Exit" Click="Exit_Click"/>
                        </ContextMenu>
                    </Button.ContextMenu>
                </Button>
                <Image Height="32" HorizontalAlignment="Left" Margin="8,8" Name="image0" Stretch="Fill" VerticalAlignment="Center" Width="32" Source="data/images/address_32.png" ToolTip="Load Address Book" MouseLeftButtonDown="ChooseProfile" />
                <Image Height="32" HorizontalAlignment="Left" Margin="48,8" x:Name="image1" Stretch="Fill" VerticalAlignment="Center" Width="32" Source="data/images/AddUser.png" ToolTip="Add Contact" MouseLeftButtonDown="NewContact_MouseDown" />
                <Image Height="32" HorizontalAlignment="Left" Margin="88,8" x:Name="image2" Stretch="Fill" VerticalAlignment="Center" Width="32" Source="data/images/save_32.png" ToolTip="Save" MouseLeftButtonDown="Save_MouseDown" />
                <Image Height="32" HorizontalAlignment="Left" Margin="128,8" x:Name="image3" Stretch="Fill" VerticalAlignment="Center" Width="32" Source="data/images/refresh.png" ToolTip="Refresh" MouseLeftButtonDown="Refresh_MouseDown" />
                <Image Height="32" HorizontalAlignment="Left" Margin="168,8" x:Name="image4" Stretch="Fill" VerticalAlignment="Center" Width="32" Source="data/images/user_32.png" ToolTip="My Card" MouseLeftButtonDown="MyCard_MouseDown" />
            </Grid>
        </ContentControl>
        <TabControl Margin="8,64,0,8" VerticalAlignment="Stretch" HorizontalAlignment="Left" Width="224">
            <TabItem Header="Groups" FontSize="16" Foreground="#FF0000A1">
                <ListBox x:Name="GroupsList" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch" SelectionChanged="GroupsList_SelectionChanged" />
            </TabItem>
        </TabControl>
        <TabControl Margin="240,64,8,8" x:Name="DetailView" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
            <TabItem Header="Contacts" x:Name="ListView" FontSize="16" Foreground="#FF0000A1">
                <local:ContactsList x:Name="contactsList" />
            </TabItem>
        </TabControl>
    </Grid>
</Window>
